<ui:component xmlns="http://www.w3.org/1999/xhtml"
              xmlns:ui="http://java.sun.com/jsf/facelets"
              xmlns:p="http://primefaces.org/ui"
              xmlns:ubb="http://java.sun.com/jsf/composite/components"
              xmlns:composite="http://java.sun.com/jsf/composite">

    <composite:interface>
        <composite:attribute name="action" required="true" method-signature="void action()" />
        <composite:attribute name="update" />
        <composite:attribute name="value" />
        <composite:attribute name="render" default="true" />
        <composite:attribute name="confirmDialogWidgetVar" required="true" />
        <composite:attribute name="confirmDialogTitle" required="true" />
        <composite:attribute name="confirmDialogMessage" required="true" />
        <composite:attribute name="icon" />
        <composite:attribute name="style" />
        <composite:attribute name="styleClass" />
    </composite:interface>

    <composite:implementation>
        <p:commandButton value="#{cc.attrs.value}"
                         rendered="#{cc.attrs.render}"
                         onclick="#{cc.attrs.confirmDialogWidgetVar}.show();return false;"
                         icon="#{cc.attrs.icon}"
                         style="#{cc.attrs.style}"
                         styleClass="#{cc.attrs.styleClass}" />
        <p:commandButton id="confirmedActionButton" value="Execute"
                         action="#{cc.attrs.action}"
                         update="#{cc.attrs.update}"
                         rendered="#{cc.attrs.render}"
                         style="display: none" />
        <ubb:confirmationDialog widgetVar="#{cc.attrs.confirmDialogWidgetVar}" actionButtonId="#{p:component('confirmedActionButton')}"
                                render="#{cc.attrs.render}" title="#{cc.attrs.confirmDialogTitle}" message="#{cc.attrs.confirmDialogMessage}" />
    </composite:implementation>
</ui:component>